import React, {Component} from 'react';
import {
  View,
  Text,
  TouchableOpacity,
  StyleSheet,
  Platform,
  Picker,
  Image,
} from 'react-native';

import Config from '../../config';
import Colors from '../../common/Colors';
import CommonStyles from '../../common/CommonStyles';
import SizeUtils from '../../common/SizeUtils';
import TImage from '../../components/TImage';
import CommonListPage from '../common/CommonListPage';
import CommonAvatarView from '../common/CommonAvatarView';
import {DateUtils} from '../../utils/Utils';
import WH_RequestPostsAction from '../../actions/workhard/WH_RequestPostsAction';
import QZ_FollowTo from '../../actions/quanzi/QZ_FollowTo';
import QZ_FollowMe from '../../actions/quanzi/QZ_FollowMe';
import QZ_FollowUser from '../../actions/quanzi/QZ_FollowUser';
import QZ_FollowListItemView from './QZ_FollowListItemView';

export default class QuanziFollowPage extends CommonListPage {
	constructor(props) {
      super(props);
      this.state={
      	listData:[]
      }
	}
  _dealEnterPage() {
    this.doRefresh();
  }
  	_getViewStyle() {
      return {paddingTop:Config.paddingTop,
        backgroundColor:"#ffffff"}
    }
  	_getListViewStyle() {
      return {
        width:SizeUtils.getWindowSize().width,
        paddingTop:0,
        height:(SizeUtils.getWindowSize().height - Config.paddingTop),
        backgroundColor:"#ff0"};
    }
    _renderTopView(){
    	return(<View style={{backgroundColor:'#f2f2f2',height:SizeUtils.translateDesignHeightToCode(20)}}/>);
    }
    _onRenderItem(data, index) {
      const {isFan} = this.props.pageData.routeData;
      const isfollow = data.is_follow;
      return(<QZ_FollowListItemView data={data} />)
  	}
    _requestData(page, listView) {
      const {isFan} = this.props.pageData.routeData;
      if (page===1) {
        this.clear();
      }
      if (isFan) {
        new QZ_FollowMe().call(listView, {
          page:page, page_size:10});
      }else{
        new QZ_FollowTo().call(listView, {
          page:page, page_size:10});
      }
    }
	  
}